﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Forums.Domain.Services
{
	using System.Collections.Generic;
	using Falcon.Core.Domain;
	using Falcon.Core.Domain.Values;

	public interface IForumPostAttachmentService
	{
		/// <summary>
		/// Gets all the attachment relations by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		IList<ForumPostAttachment> GetAll(ForumPostAttachmentSpecification specification);

		/// <summary>
		/// Gets all the attachment relations by the specified values.
		/// </summary>
		/// <param name="values">The values.</param>
		/// <returns></returns>
		Dictionary<int, IList<Attachment>> GetAll(int[] values);

		/// <summary>
		/// Creates the attachment relation.
		/// </summary>
		ForumPostAttachment Create();

		/// <summary>
		/// Process the attachment relation for the specified post
		/// </summary>
		/// <param name="post">The post.</param>
		/// <param name="value">The attachment value.</param>
		/// <param name="attachments">The attachments.</param>
		/// <returns></returns>
		bool Process(ForumPost post, AttachmentCreate value, IList<ForumPostAttachment> attachments);

		/// <summary>
		/// Inserts the specified relation.
		/// </summary>
		/// <param name="relation">The relation.</param>
		void Insert(ForumPostAttachment relation);

		/// <summary>
		/// Inserts the specified attachment relations for the specified post.
		/// </summary>
		/// <param name="post">The post.</param>
		/// <param name="attachments">The attachments.</param>
		void Insert(ForumPost post, IList<AttachmentStore> attachments);

		/// <summary>
		/// Deletes the specified relation.
		/// </summary>
		/// <param name="relation">The relation.</param>
		void Delete(ForumPostAttachment relation);
	}
}